<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="UTF-8"%>
<html>
<head>
    <title>Logistics System</title>
</head>
<body>
<%-- 头部 --%>
<jsp:include page="top2.jsp"/>

<!-- purchase section -->
<section class="contact_section layout_padding">
    <div class="container">
        <div class="heading_container">
            <h2>
                购买商品
            </h2>
        </div>
        <div class="">
            <div class="">
                <div class="row">
                    <div class="col-md-9 mx-auto">
                        <div class="contact-form">
                            <form action="purchase-do1.jsp" name="purchaseForm">
                                <input type="text" name="name" id="name" placeholder="购买人名称（仅限英文字符，10字符以内）"
                                       maxlength="10" style="color: gray" onkeyup=this.value=this.value.replace(/[^a-zA-Z]/g,'')>
                                <h2 style="position: relative;
                                            font-weight: bold;
                                            ">
                                    请输入商品购买数量
                                </h2>

                                <div>
                                    <input type="text" name="thing1" id="thing1" placeholder="苹果 5元/kg">
                                </div>
                                <div>
                                    <input type="text" name="thing2" id="thing2" placeholder="香蕉 3元/kg">
                                </div>
                                <div>
                                    <input type="text" name="thing3" id="thing3" placeholder="梨 4元/kg">
                                </div>
                                <div>
                                    <input type="text" name="thing4" id="thing4" placeholder="橘子 6元/kg">
                                </div>
                                <div class="d-flex justify-content-center">
                                    <button type="submit" class="btn_on-hover" onclick="return checkName()">
                                        购买
                                    </button>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<script type="text/javascript">
    function checkName() {
        var name = purchaseForm.name.value;
        if (name == "" || name == null) {
            alert("请输入用户名");//弹出提示
            purchaseForm.name.focus();//把鼠标焦点移到name里
            return false;
        }
        return true;
    }
</script>

<!-- end purchase section -->

<jsp:include page="footer.jsp"/>
</body>
</html>
